{% from 'message_box.html' import message_box %}
{% from 'events/contributions/management/_types_table.html' import types_table_row %}

<div class="manage-types">
    <div class="toolbar space-after hide-if-locked">
        <button class="i-button js-new-type icon-plus highlight"
                data-href="{{ url_for('.create_type', event) }}"
                data-title="{% trans %}Add new contribution type{% endtrans %}"
                data-ajax-dialog>
            {% trans %}New contribution type{% endtrans %}
        </button>
    </div>

    {% if contrib_types %}
        <table class="i-table">
            <thead>
                <tr class="i-table">
                    <th class="i-table">
                        {% trans %}Name{% endtrans %}
                    </th>
                    <th class="i-table">
                        {% trans %}Description{% endtrans %}
                    </th>
                    <th class="i-table">
                        {% trans %}Private{% endtrans %}
                    </th>
                    <th class="i-table action-column hide-if-locked"></th>
                </tr>
            </thead>
            <tbody>
                {% for contrib_type in contrib_types %}
                    {{ types_table_row(contrib_type) }}
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        {%- call message_box('info') %}
            {%- trans %}There are no contribution types yet.{% endtrans %}
        {%- endcall %}
    {% endif %}

    <div class="toolbar f-j-end">
        <button class="i-button big" data-button-back>{% trans %}Close{% endtrans %}</button>
    </div>
</div>
<script>
    setupTypesDialog();
</script>
